package com.goparry.taskman.inbox;

import com.goparry.taskman.R;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

public class TaskFragment extends Fragment{
	private String mTaskName;
	View mView;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
    	mView = inflater.inflate(R.layout.taskfragment, container, false);
		// Configure the Task Help button
		Button btn = (Button)mView.findViewById(R.id.taskhelp);
		btn.setOnClickListener((OnClickListener) getActivity());
		

        return mView;
    }
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }
	public void updateTask(Bundle taskBundle) {
		// Populate the task data
		TextView name = (TextView)mView.findViewById(R.id.name);
		mTaskName = taskBundle.getString("name");
		name.setText(mTaskName);
		
		name = (TextView)mView.findViewById(R.id.title);
		name.setText(taskBundle.getString("title"));

		name = (TextView)mView.findViewById(R.id.step);
		name.setText(taskBundle.getString("step"));

		name = (TextView)mView.findViewById(R.id.instructions);
		name.setText(taskBundle.getString("instructions"));
		
		name = (TextView)mView.findViewById(R.id.received_date);
		name.setText(taskBundle.getString("received_date"));
		
		name = (TextView)mView.findViewById(R.id.due_date);
		name.setText(taskBundle.getString("due_date"));		
	}
}
